Option Explicit

Private Sub ComboBox1_Change()
  intTopIndex = Me.ComboBox1.TopIndex
End Sub

'POUR COMBOBOX'


Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  ' Dfinir les noms des objet  l'ouverture de l'USF
  ' sont utiliss dans le code du hook
  Set ObjUSF = Me: Set ObjList = Me.ComboBox1
  'Store the first TopIndex Value
  intTopIndex = Me.ComboBox1.TopIndex
  '
  Hook_Mouse
End Sub

' Check to see if focus is lost
Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  UnHook_Mouse
End Sub



'POUR LISTBOX'


Private Sub ListBox1_Change()
  intTopIndex = Me.ListBox1.TopIndex
End Sub

Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  UnHook_Mouse
End Sub

Private Sub ListBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  ' Dfinir les noms des objet  l'ouverture de l'USF
  ' sont utiliss dans le code du hook
  Set ObjUSF = Me: Set ObjList = Me.ListBox1
  'Store the first TopIndex Value
  intTopIndex = Me.ListBox1.TopIndex
  '
  Hook_Mouse
End Sub

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  UnHook_Mouse
End Sub
